#!/bin/sh

#Dashboad use Influxdb, Grafana
#influxdb
repos_influxdb="image.int.jumei.com/influxdb:latest"
repos_grafana="image.int.jumei.com/grafana:latest"
param="-d"
if [ "$1" = "dev" ];then
  repos_influxdb="influxdb:latest"
  repos_grafana="grafana/grafana:latest"
fi

docker run $param \
    -p 8083:8083 -p 8086:8086 -p 8089:8089/udp \
    -v $PWD/influxdb.conf:/etc/influxdb/influxdb.conf:ro \
    -v /home/data/influxdb:/var/lib/influxdb \
    -v /home/logs/influxdb:/var/log/influxdb \
    $repos_influxdb

#grafana
docker run $param \
  -p 3000:3000 \
  -v $PWD/grafana.ini:/etc/grafana/grafana.ini \
  -v /home/data/grafana:/var/lib/grafana \
  -v /home/logs/grafana:/var/log/grafana \
  $repos_grafana
